{include file='public/header.html'}

<div class="container mtn">

    <div class="well clearfix">
        <strong>公告：<span class="text-danger">{:site('site_notice', '暂无公告！')}</span></strong>
    </div>

    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">文档{if session('?user'):}<span class="pull-right"><a href="{:url('doc/add')}">新增</a></span>{/if}</h3>
        </div>
        <div class="panel-body row">
            {php $list=db('doc')->where('status=1')->order('sort ASC,id ASC')->select()}
            {foreach $list as $vo}
            <div class="col-lg-3">
                <div class="panel panel-default">
                    <a href="{:url('md/index',['id'=>get_start_id($vo['id'])])}"><img class="card-img-top" src="{:aphp_thumb($vo['thumb'], $vo['id'])}" width="100%" alt="{$vo.title}" /></a>
                    <div class="panel-body">
                        <h4 class="card-title"><a href="{:url('md/index',['id'=>get_start_id($vo['id'])])}">{$vo.title}</a></h4>
                        <p class="card-text" style="height:40px;overflow:hidden">{$vo.summary}</p>
                        <p class="text-right">
                            <a href="{:url('doc/down',['id'=>$vo['id']])}">下载
                                {if session('?user'):}
                                | <a href="{:url('doc/edit',['id'=>$vo['id']])}">修改</a> |
                                <a href="javascript:ajaxConfirm('{:url('doc/del',['id'=>$vo['id']])}','删除',1);">删除</a> |
                                <a href="{:url('md/add',['doc_id'=>$vo['id']])}">写入</a>
                                {/if}
                        </p>
                    </div>
                </div>
            </div>
            {/foreach}
            {empty $list:}
            <div class="well">暂无文档</div>
            {/empty}
        </div>
    </div>
</div>

{include file='public/footer.html'}
</body>
</html>